package cn.itcast.dao;

import cn.itcast.pojo.Menu;
import cn.itcast.pojo.User;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {
    List<String> findRoleByUsername(String username);

    List<String> findPermissionByUsername(String username);

    User findUserByUsername(String username);

    Integer save(User user);

    Integer saveUserAndRole(@Param("userId") Integer userId,@Param("roleId") Integer roleId);

    Page<User> selectByCondition(String queryString);

    User findById(Integer id);

    List<Integer> findRoleIdsByUserId(Integer userId);

    void deleteUserAndRole(Integer userId);

    Integer delete(Integer userId);
}
